<template>
	<view class="container" :class="'theme-'+theme">
	<view class="addTitle">
		<view class="titleDetail">
			<view class="titleLeft" > 
				<image src="../../static/newh5/fanhui.png" 
				class="yticon" 
				style="width: 13px;height: 20px;color:black" 
				@click="returnIndex()"
				></image>
			</view>
			<view class="titleCenter" >
			<b class="titleText">版本记录</b>
			</view>
			<view class="titleRight"  style="color: #269cd3;flex:1" > </view>
		</view>
		</view>
		<view class='m-title'>
			<view>
				<text class="titles">{{lists.title}}</text>

			</view>
			<view class="mar">
				<text class="text-color">{{lists.issueDate}}</text>
			</view>

		</view>
		<view>
			<!-- <p class='mar'>1.修复已知bug</p>
			<p class='mar'>2.新增功能</p> -->
			<view class="contentText"  v-html="lists.content"></view>
		</view>
	</view>
</template>

<script>
import {  goback } from "@/common/utils/navigateBack.js";
	import {
		getDetailVersion,
		checkVersionByVersionId
	} from '../../api/set/set.js'
	export default {
		data() {
			return {
				lists:{},
				listId:'',
			}
		},
		onLoad(op) {
			console.log('op',op["item "]);
			this.listId = JSON.parse(op["item "]) 
			this.getDetailVersion()
			// console.log('op',JSON.parse(op["item "]));
			// this.lists = JSON.parse(op["item "])
			// console.log('11',this.lists);
			// this.loadData();
		},
		onBackPress() {  
		  
		},
		methods: {
			returnIndex() {
				goback()
			},
			getDetailVersion(){
				const params = {
					versionId:this.listId
				}
				getDetailVersion(params).then(res=>{
					if(res.code == 0){
						console.log('res',res.data);
						res.data.content = res.data.content.replace(/\<table/gi, '<div style="width:100%;overflow: auto;"><table');
						res.data.content = res.data.content.replace(/\<\/table>/gi, '</table></div>');

						this.lists = res.data
					}
				})
				checkVersionByVersionId(params).then(res =>{})
			}
		}
	}
</script>

<style>
	.m-title {
		text-align: center;
		margin-top: 10px;
	}

	.titles {
		font-size: 18px;
		font-weight: bold;
	}
	
	.mar {
		margin: 10upx;
	}
	
	.text-color {
		color: #C0C0C0;
	}
	.contentText >>> table{
		width: 100%;
		padding: 10px;
		word-wrap:break-word;
		
	}

	.contentText >>> td{
		width: 100%;
		padding: 10px;
	}
	.contentText >>> tr{
		/* width: 100%;
		padding: 10px; */
		/* text-overflow: ellipsis;
		white-space: nowrap; 
		 overflow: hidden;  */
	}
</style>
